package com.mxpio.erp.common.sales.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import com.mxpio.erp.common.jpa.model.Order;
import com.mxpioframework.security.annotation.Dict;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_SALES_INVOICE")
@ApiModel(value="发票")
public class Invoice extends Order {

	private static final long serialVersionUID = 1L;

	@Column(name = "INVOICE_NO_")
	@ApiModelProperty(value = "发票号")
	private String invoiceNo ;

	@Column(name = "SALES_ORDER_NO_")
	@ApiModelProperty(value = "销售订单号")
	private String salesOrderNo ;

	@Column(name = "INVOICE_TYPE_")
	@Dict(dicCode = "ERP_SALES_INVOICE_KIND")
	@ApiModelProperty(value = "发票类型")
	private String invoiceType;

	@Column(name = "BILLING_DATE_")
	@ApiModelProperty(value = "开票日期")
	private Date billingDate;

	@Column(name = "SALESMAN_")
	@ApiModelProperty(value = "业务员")
	private String salesman ;

	@Column(name = "CURRENCY_")
	@ApiModelProperty(value = "币种")
	@Dict(dicCode = "ERP_COMMON_CURRENCY")
	private String currency ;

	@Column(name = "BIZ_TYPE_")
	@ApiModelProperty(value = "业务类型")
	private String bizType ;

	@Column(name = "BIZ_PARTNER_")
	@ApiModelProperty(value = "业务伙伴")
	private String bizPartner ;

	@Column(name = "PAYMENT_TERMS_")
	@ApiModelProperty(value = "付款条件")
	private String paymentTerms ;

	@Column(name = "MEMO_")
	@ApiModelProperty(value = "备注")
	private String memo;

	@Override
	public String initTypeCode() {
		return "IV1";
	}
}
